# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=qmidictl
pkgver=0.9.9
pkgrel=1
pkgdesc="MIDI remote control application sending MIDI data over network using UDP/IP multicast"
arch=(loong64 x86_64)
url="https://qmidictl.sourceforge.io/"
license=(GPL2)
groups=(pro-audio)
depends=(
  gcc-libs
  glibc
  hicolor-icon-theme
  qt6-base
  qt6-svg
)
makedepends=(
  cmake
  qt6-tools
)
optdepends=(
  'qt6-wayland: for native wayland support'
)
source=(https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz)
sha512sums=('90a1d07076d3d411b4dc36b094c398088b9fd469d1531e64beedefe83d30bd5b46db8ac8642c514a4a224c3ddcd772ff3e4241fffcd1d3fd29f5cd3975303470')
b2sums=('afae297f5ca82d7aa1b94180c5002c911583ac991ad6e348a28d776798f8986ed1e5abcd039d4733117eff1d16c674933db2dca030c7eff746d0055696969f84')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -D CONFIG_QT6=ON
    -S $pkgname-$pkgver
    -W no-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 $pkgname-$pkgver/{ChangeLog,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}
